import { api } from '@/utils/request'
import type { Wish, CreateWishRequest, UpdateWishRequest } from '@/types/wish'

// 获取所有愿望
export const getWishes = () => {
  return api.get<Wish[]>('/wishes')
}

// 创建愿望
export const createWish = (data: CreateWishRequest) => {
  return api.post<Wish>('/wishes', data)
}

// 更新愿望
export const updateWish = (id: number, data: UpdateWishRequest) => {
  return api.put<Wish>(`/wishes/${id}`, data)
}

// 删除愿望
export const deleteWish = (id: number) => {
  return api.delete(`/wishes/${id}`)
}
